home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / boiler_b.swf / scripts / DefineSprite_152 / frame_1 / DoAction.as
Encoding:
Text File  |  2011-03-26  |  1.1 KB  |  60 lines

  1. var pNum = Number(this._name.slice(6,-3));
  2. this.setPos = function(ty, tdir)
  3. {
  4.    var _loc1_ = this;
  5.    _loc1_._x = pX + 38;
  6.    _loc1_._y = pY - ty;
  7.    if(_loc1_._y < -300 && tdir > 0)
  8.    {
  9.       if(pNum < 3)
  10.       {
  11.          pNum += 5;
  12.          _loc1_.resetMe();
  13.       }
  14.    }
  15.    else if(_loc1_._y > 500 && tdir < 0)
  16.    {
  17.       if(pNum > 4)
  18.       {
  19.          pNum -= 5;
  20.          _loc1_.resetMe();
  21.       }
  22.    }
  23. };
  24. this.setUp = function(x, y, frame)
  25. {
  26.    var _loc1_ = this;
  27.    _loc1_.pX = x * 16;
  28.    _loc1_.pY = y * 16;
  29.    _loc1_.gotoAndStop(frame);
  30. };
  31. this.resetMe = function()
  32. {
  33.    var _loc1_ = this;
  34.    switch(pNum)
  35.    {
  36.       case 0:
  37.          _loc1_.setUp(24,7,5);
  38.          break;
  39.       case 1:
  40.          _loc1_.setUp(0,33,12);
  41.          break;
  42.       case 2:
  43.          _loc1_.setUp(0,56,7);
  44.          break;
  45.       case 3:
  46.          _loc1_.setUp(29,83,11);
  47.          break;
  48.       case 4:
  49.          _loc1_.setUp(0,109,13);
  50.          break;
  51.       case 5:
  52.          _loc1_.setUp(34,110,10);
  53.          break;
  54.       case 6:
  55.          _loc1_.setUp(0,125,8);
  56.    }
  57. };
  58. this.resetMe();
  59. stop();
  60.